<?php 

require_once('../include/GeneralTop.php');
require('../include/class/db.php');
require('../include/class/pagination.php');
require('../include/simpleHeader.php');

$id  = "-1";
if (isset($_GET['PId'])) {
  $id  = $_GET['PId'];
}

$db = new db;
$sql = sprintf("SELECT * FROM petlostfound WHERE PId = %s", GetSQLValueString($id, "int"));
$res = $db->query($sql);
$row = $db->fetch($res);

?>

<body topmargin="0" leftmargin="0">
<table width="777" border="0" align="left" cellpadding="0" cellspacing="0" valign="top">
  <tr>
    <td width="777" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="51" valign="top" background="../images/fen_09.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="16">&nbsp;</td>
            </tr>
          </table>
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="14"><img src="../images/fen_12.gif" width="7" height="29"></td>
              <td width="405"><span class="font_16px_black_B"><?php echo TEXT_LOST_INFO?></span></td>
              <td width="15">&nbsp;</td>
              <td width="299" align="right" class="font_12px_gray"><a href="javascript:history.go(-1);" class="gray_12px">[<?php echo TEXT_BACK?>]</a></td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="1" bgcolor="#767676"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="8"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top" class="font_12px_gray"><table width="735" border="0" align="center" cellpadding="0" cellspacing="0" class="font_12px_gray">
            <tr>
              <td width="60" height="30" align="left" valign="middle"><div align="left"><strong><?php echo TEXT_TYPE?>：</strong></div></td>
              <td width="60"><?php echo getPetType($row['PType']); ?></td>
              <td width="100"><div align="left"><strong><?php echo TEXT_VARIETY?>: </strong></div></td>
              <td width="200"><?php echo $row['PVariety']; ?></td>
              <td width="100"><div align="left"><strong><?php echo TEXT_GENDER?>: </strong></div></td>
              <td width="160"><?php echo getGender($row['PGender']); ?></td>
            </tr>
            <tr>
              <td width="60" height="30" align="left" valign="middle"><div align="left"><STRONG><?php echo TEXT_LOST_FOUND?>: </STRONG></div></td>
              <td width="60"><?php echo getLostType($row['PIsLost']); ?></td>
              <td width="100"><div align="left"><STRONG><?php echo TEXT_LOST_PLACE?>: </STRONG></div></td>
              <td width="200"><?php echo $row['PPlace']; ?></td>
              <td width="100"><div align="left"><STRONG><?php echo TEXT_LOST_DATE?>: </STRONG></div></td>
              <td width="160"><?php echo $row['PDate']; ?></td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr>
              <td colspan="6"><p><STRONG><?php echo TEXT_LOST_INFO?>: </STRONG></p>
                <p><?php echo nl2br($row['PDescription']); ?></p>
                <p>
                <?php
			    if('' != $row['PPhoto'] && NULL != $row['PPhoto']) {
			    ?>
			    <img class="img_border" src="<?php echo IMAGES_PET_FOLDER.$row['PPhoto']; ?>" border="0" class="img_border">
			    <?php
			    }
			    if('' != $row['PPhoto2'] && NULL != $row['PPhoto2']) {
			    ?>
			    <img class="img_border" src="<?php echo IMAGES_PET_FOLDER.$row['PPhoto2']; ?>" border="0" class="img_border">
			    <?php
			    }
			    if('' != $row['PPhoto3'] && NULL != $row['PPhoto3']) {
			    ?>
			    <img class="img_border" src="<?php echo IMAGES_PET_FOLDER.$row['PPhoto3']; ?>" border="0" class="img_border">
			    <?php
			    }
			    ?>
                  <br>
                  </p></td>
              </tr>
            <tr>
			  <td align="left">
			   	<br><input type="button" id="button" name="button" value="<?php echo TEXT_BACK?>" onclick="javascript:history.go(-1);"/>
			  </td>
			  <td>&nbsp;</td>   
			  </tr>
          </table>
          <p>&nbsp;</p></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="8"></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>